﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog x-modal-dialog" style="width: 600px;margin-top: 150px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb clearfix">

      <h2><i class="glyphicon glyphicon-fire" title=""></i>&nbsp;&nbsp;<span>编辑薪资</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/principals/${coachId}/settlements/${settlement.id}" data-validate="true">

      <input type="hidden" name="_method" value="PATCH" >
      <input type="hidden" name="settlementId" value="${settlement.id}" >

      <div class="modal-body">
      
        <div class="form-group x-form-group">
          <label class="col-xs-4 control-label">课程名称：</label>
          <div class="pull-left col-xs-6">
            <p class="form-control-static">${settlement.course.name}</p>
          </div>
        </div>

        <div class="form-group x-form-group">
          <label class="col-xs-4 control-label">金额：</label>
          <div class="pull-left col-xs-6">
            <input name="settlement" type="text" class="form-control" value="${settlement.settlement / 100}" data-validate="required">
          </div>
        </div>
        
        <div class="modal-footer">
          <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
          <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
        </div>
        
      </div>
      
    </form>
  </div>
</div>

<script src="${ctx.resource}/js/bootstrap.validate.trigger.js"></script>
<script type="text/javascript">
  $(function(){
    
    $('form').shiftform({
        beforeSubmit : function(el) {
            $('form').trigger("validate.ajax.submit");
            return $.bt_validate.result[$.bt_validate.form_id]
        }
    });
  })
</script>